*PUBLICATION: Goerres, Achim/Elis, Jonas/Mayer, Sabrina J./Spies, Dennis C. (2024): Integration in the Host Country, Mean Political Interest and Focus Shift towards Host Country Politics: Patterns of Transnational Political Interest among Germans from Turkey. Political Studies, https:...

*DATASET: Goerres, Achim/Spies, Dennis C./Mayer, Sabrina J. (2020): Immigrant German Election Study (IMGES). Scientific-Use Data Set.

*NOTES: In this paper, we use data from IMGES I from 2017. This is a reduced version of the scientific-use dataset and is intended exclusively for replication. The full public data set can be found here: Goerres, Achim/Spies, Dennis C./Mayer, Sabrina J. (2020): Immigrant German Election Study (IMGES). GESIS, Köln. ZA7495 Datenfile Version 2.0.0, https://search.gesis.org/research_data/ZA7495.


******************
*DATA PREPARATION*
******************

cd "..."
use "imges1_transnat_dataverse.dta", clear


****************
*CODING SECTION*
****************

*Dependent variables

*Political interest
recode q69 5=0 99=0 98=0 4=1 3=2 2=3 1=4, gen(polint_ger) // Change direction of variable
label variable polint_ger "Pol. interest Germany"
label define int 0 "No interest" 1 "Little int." 2 "Medium int." 3 "Strong int." 4 "Very strong int."
label values polint_ger int

recode mws_020 99=0 98=0 5=0 4=1 3=2 2=3 1=4, gen(polint_tr) // Change direction of variable, no info recoded to no interest
label variable polint_tr "Pol. interest Turkey"
label values polint_tr int

*Standardisation to min=0 max=1
foreach var of varlist polint_ger polint_tr {
	sum `var'
	replace `var'=(`var'-r(min))/(r(max)-r(min))
}

*Net political interest in Germany minus political interest in Turkey
gen polint_net=polint_ger-polint_tr

*Mean level of political interest
egen polint_mean=rowmean(polint_ger polint_tr)


*Independent variables

*Gender
recode q1 1=1 2=0, gen(male)
label variable male "Gender: male"
label define male 0 "Female" 1 "Male"
label values male male

*Migration generation
gen alter_zuzug=mwsd_004_j-q2c
recode mwsd_002 1=1 2=0, gen(miggen2)
label variable miggen2 "Migrant generation (ref: 1st gen)"
label define miggen2 0 "1st gen" 1 "2nd gen"
label values miggen2 miggen2

*Double citizen
recode mwsd_013 (2=0)(1=1)(else=0), gen(dualcit) // "Don't know" option recoded to mono citizen
tab dualcit
label variable dualcit "Dual citizen"

*Member of discriminated minority: Kurd, Yezide, Alevi
recode mws_026c 5=0 else=1, gen(min_kurd) // Assuming that those with no answer also Kurd
recode mws_022 3=1 5=1 else=0, gen(min_al_yez)
gen min_discr=min_kurd+min_al_yez
recode min_discr 2=1
label variable min_discr "Disc. minority K/A/Y"

*Economic integration
*Education
gen school_foreign=0
replace school_foreign=1 if qf0119<10&qf0122_4 !=1
replace school_foreign=2 if qf0119>=10&qf0119 <12&qf0122_4 !=1
replace school_foreign=3 if qf0122_4 ==1
recode q169(1/2=1)(3=2)(4/5=3)(else=0), gen(school_domestic)
gen education=school_domestic
replace education=school_foreign if education==.												
recode education (1=0) (2=0.5) (3=1)										

*Economic situation
recode q63 (1=5) (2=4) (3=3) (4=2) (5=1) (else=.), gen(econsit)
recode econsit (1 2=0) (3=0.5) (4 5=1)

gen h_hhincome = q229/q165 // GLES pre-election survey 2017 data: 3.6 average, weighted, household controled
sum h_hhincome [aweight=tdwadj2]
gen hhincome =.
replace hhincome =0 if h_hhincome<=2
replace hhincome =0.5 if h_hhincome >2 & h_hhincome < 3.3
replace hhincome =1 if h_hhincome >=3.3
replace hhincome =. if h_hhincome ==.
tab hhincome

*Employment status
recode q171 (7=0) (else=1), gen(employed)										

*Code index: economic integration
egen integr_econ = rowmean(education econsit hhincome employed)
label variable integr_econ "Integration: economic"

*Social integration
gen partner_ausl=1 if mwsd_026==2
replace partner_ausl=0 if mwsd_028==18
replace partner_ausl=1 if mwsd_026==1&mwsd_028!=18
replace partner_ausl=1 if mwsd_026==1&mwsd_029!=18
replace partner_ausl=2 if mwsd_027==1&partner_ausl>0 
replace partner_ausl=2 if mwsd_028==1&partner_ausl>0
replace partner_ausl=2 if mwsd_029==1&partner_ausl>0
replace partner_ausl=. if mwsd_028==98|mwsd_029==98
tab partner_ausl

label define partner 0"Germany" 1"Foreign" 2"Same origin"
label value partner_ausl partner

gen gerpartner =.
replace gerpartner =1 if partner_ausl ==0 & q168 ==1							// German partner not in hh (assimilated)
replace gerpartner =1 if partner_ausl ==0 & q168 ==2							// German partner in hh (assimilated)
replace gerpartner =1 if partner_ausl ==0 & q167 ==1							// Married with german partner (assimilated)
replace gerpartner =0.5 if q167 ==1 & partner_ausl ==2							// Married, partner with same descent (separated)
replace gerpartner =0.5 if q167 ==1 & partner_ausl ==. & q168 ==.				// Married, else missing (separated)
replace gerpartner =0.5 if q167 ==1 & partner_ausl ==1							// Married, partner with other foreign descent (separated)
replace gerpartner =0.5 if partner_ausl ==. & q168 ==1							// Missing descent, partner not in hh (separated) ???
replace gerpartner =0.5 if partner_ausl ==2 & q168 ==1							// Partner with same descent not in hh (separated)
replace gerpartner =0.5 if partner_ausl ==2 & q168 ==2							// Partner with same descent in hh (separated)
replace gerpartner =0.5 if partner_ausl ==1 & q168 ==2							// Foreign partner in hh (separated)
replace gerpartner =0.5 if partner_ausl ==1 & q168 ==1							// Foreign partner in hh (separated)
replace gerpartner =0.5 if q167 ==2												// Married, but living in separation (separated)
replace gerpartner =0.5 if partner_ausl ==2 & q168 ==2							// Partner with same descent in hh (separated)
replace gerpartner =0 if q167 ==5 & q168 ==3									// Single after both questions (marginalized)
replace gerpartner =0 if q167 ==6 & q168 ==3									// Divorced, no partner (marginalized)
replace gerpartner =0 if q167 ==7 & q168 ==3									// Widowed, no partner (marginalized)

*Reported share of native friends						
recode mws_012 (1=0) (2=0.5) (3=0.5) (4=1) (else=.), gen(gerfriends)

*Reported share of native co-workers
recode mws_013 (1=0) (2=0.5) (3=0.5) (4=1) (else=.), gen(gercolleagues)

*Relation between native and migrant organisation-memberships
foreach var of varlist mws_010aa mws_010ab mws_010ac mws_010ad mws_010ae mws_010af mws_010ag mws_010ah mws_010ai {
	recode `var' (1=1) (2=0) (else=.), gen(h_`var')
	}
gen orgaindex = h_mws_010aa + h_mws_010ab + h_mws_010ac + h_mws_010ad + h_mws_010ae + h_mws_010af + h_mws_010ag + h_mws_010ah + h_mws_010ai
foreach var of varlist mws_011a mws_011b mws_011c mws_011d mws_011e mws_011f mws_011g mws_011h mws_011i {										
	recode `var' (1=1) (2=0) (else=0), gen(h_`var')								
	}
gen migorgaindex = h_mws_011a + h_mws_011b + h_mws_011c + h_mws_011d + h_mws_011e + h_mws_011f + h_mws_011g + h_mws_011h + h_mws_011i
gen hratio = migorgaindex / orgaindex
gen orgamem =.																	
replace orgamem =0 if orgaindex ==0 // Marginalized
replace orgamem =0.5 if hratio >=0.5 & orgaindex >0 // Separated, integrated
replace orgamem =1 if orgaindex >0 & hratio <0.5 // Assimilated with memberships in only german-majority organisations
tab orgamem

sum gerpartner gerfriends gercolleagues orgamem

*Code index: social integration
egen integr_social = rowmean(gerpartner gerfriends gercolleagues orgamem)		
label variable integr_social "Integration: social"

*Cultural integration
gen language =.																	
replace language =1 if mws_072a ==1
replace language =0.75 if mws_072a ==2
replace language =0.25 if mws_072a ==3 | mws_072a==98 | mws_072a==. // "Don't know" option recoded to mediocre
replace language =0 if mws_072a ==5 | mws_072a ==4
tab language

*Language use at work
recode mws_073a (1=1) (2=0.75) (3=0.75) (4=0.25) (5=0) (else=.), gen(languse_work)
sum languse_work
replace languse_work=r(mean) if languse_work==.

*Language use with friends
recode mws_073b (1=1) (2=0.75) (3=0.75) (4=0.25) (5=0) (else=.), gen(languse_friend)
sum languse_friend
replace languse_friend=r(mean) if languse_friend==.

*Language use with family
recode mws_073c (1=1) (2=0.75) (3=0.75) (4=0.25) (5=0) (else=.), gen(languse_fam)

sum languse_fam
replace languse_fam=r(mean) if languse_fam==.
tab1 languse_fam languse_friend languse_work
gen languse = (languse_work + languse_friend + languse_fam)/3
tab languse

*Code index: cultural integration
egen integr_cult = rowmean(language languse)
label variable integr_cult "Integration: linguistic"

*Identities
recode mws_026a 5=0 4=.25 3=.5 2=.75 1=1 else=., gen(ident_ger)
replace ident_ger=r(mean) if ident_ger==.
label variable ident_ger "Identification German"

recode mws_026b 5=0 4=.25 3=.5 2=.75 1=1 else=., gen(ident_tr)
sum ident_tr
replace ident_tr=r(mean) if ident_tr==.
label variable ident_tr "Identification Turkish"

gen ident_net=ident_ger-ident_tr
label variable ident_net "Net identification German minus Turkish"

egen ident_mean=rowmean(ident_ger ident_tr)
label variable ident_mean "Mean identity"

*Turkish language
recode mws_072b 6=0 4/5=.25 3=.5 2=.75 1=1 else=., gen(lang_tr)
sum lang_tr
replace lang_tr=r(mean) if lang_tr==.
label variable lang_tr "Self-reported command of Turkish"

*Discrimination: origin group
capture drop discrim01
gen discrim01 = mws_033_1 + mws_033_2 + mws_033_3 + mws_033_4 + mws_033_5
recode discrim01 (.=0) (2/5=1)
label variable discrim01 "Slf-rprtd discrim: descent, language, reli"

*Discrimination: self-experience in everyday life
foreach var of varlist mws_034a mws_034b mws_034c mws_034d mws_034e {
	recode `var' (98=0)(99=0)(.=0), gen(rec_`var')
}
gen self_discrim_idx = rec_mws_034a + rec_mws_034b + rec_mws_034c + rec_mws_034d + rec_mws_034e
recode self_discrim_idx (0=0) (1/15=1)

*Contact with family in Turkey
recode mws_018  6=1 .=1 99=1 98=1 else=0, gen(contactabr_no)
recode mws_018 4/5=1 else=0, gen(contactabr_some)
recode mws_018  1/3=1 else=0, gen(contactabr_intens)
label variable contactabr_no "Contact with Turkish family: none"
label variable contactabr_some "Contact with Turkish family: some"
label variable contactabr_intens "Contact with Turkish family: intense"

*Media consumption
recode mws_017a (98 99=.), gen(npconsum)
recode mws_017b (98 99=.), gen(tvconsum)

capture drop mediaindex
gen mediaindex = npconsum + tvconsum
label variable mediaindex "combined German newspaper and TV consumption for information about Turkey"
summ mediaindex
replace mediaindex=(mediaindex-r(min))/(r(max)-r(min))

*Contextual data
gen neighb_tr=p8_met_p_tuerkei/100
label variable neighb_tr "% of neighbours of Turkish origin" 

sum neighb_tr
gen neighb_tr01=(neighb_tr-r(min))/(r(max)-r(min))
sum neighb_tr01
replace neighb_tr01=r(mean) if neighb_tr==.
label variable neighb_tr01 "% of neighbourhood of Turkish descent, 0 to 1"

sum p8_kkr_w_proeinw
gen neigh_purchpow=(p8_kkr_w_proeinw-r(min))/(r(max)-r(min))
sum neigh_purchpow
replace neigh_purchpow=r(mean) if neigh_purchpow==.
label variable neigh_purchpow "Purchase power in neighbourhood"


**************
*DATA ANALYSES
**************

*Survey set data
svyset _n, weight(tdwadj2)

// Table 2: The distribution of interest in German politics and in Turkish politics
*Association political interest
corr polint_ger polint_tr
ktau polint_ger polint_tr

tab polint_ger polint_tr, V cell

corr polint_ger polint_tr if male==0
corr polint_ger polint_tr if male==1

corr polint_ger polint_tr if miggen2==0
corr polint_ger polint_tr if miggen2==1

// Table A.4: Bivariate correlations between independent variables and political interest in German and Turkish politics
foreach var of varlist male miggen dualcit lang_tr contactabr_some contactabr_intens min_disc neighb_tr01 neigh_purchpow integr_econ integr_social integr_cult ident_net ident_mean discrim01 {
	capture drop meancoff_`var' netcoff_`var'
	svy: reg polint_mean `var'
	gen meancoff_`var' = e(b)[1,1]
	svy: reg polint_net `var'
	gen netcoff_`var' = e(b)[1,1]
}

// Figure 1: Net political interest, tilt in favour of German or Turkish politics
hist polint_net, discrete percent

// Figure A.1: Distribution of integration variables
hist integr_econ, discrete percent
hist integr_social, discrete percent
hist integr_cult, discrete percent

// Table 3: Regressions on transnational political interest: increases in adjusted R² values, depending on independent variables
// Table 4: Marginal effect for variable net identification German minus Turkish
// Table A.5: OLS-Regression with dependent variable mean political interest among Germans from Turkey and their children in 2017
// Table A.6: OLS-Regression with dependent variable net political interest among Germans from Turkey and their children in 2017
// Table A.7: Full multiple regression models including German media consumption for information about Turkey as dependent variable

*Multivariate analyses
local controls male miggen dualcit lang_tr contactabr_some contactabr_intens min_disc neighb_tr01 neigh_purchpow 

*Mean political interest
svy: reg polint_mean `controls'
svy: reg polint_mean `controls' integr_econ
svy: reg polint_mean `controls' integr_social
svy: reg polint_mean `controls' integr_cult ident_net ident_mean
svy: reg polint_mean `controls' discrim01
svy: reg polint_mean `controls' integr_econ integr_social integr_cult ident_net ident_mean discrim01

*Net political interest
svy: reg polint_net `controls'
svy: reg polint_net `controls' integr_econ
svy: reg polint_net `controls' integr_social
svy: reg polint_net `controls' integr_cult ident_net ident_mean
svy: reg polint_net `controls' discrim01
svy: reg polint_net `controls' integr_econ integr_social integr_cult ident_net ident_mean discrim01

*Interaction
reg polint_net `controls' integr_econ integr_social integr_cult c.ident_net##i.discrim01 [pw=tdwadj2]
	
*Robustness checks
reg polint_net `controls' integr_econ integr_social integr_cult ident_net ident_mean discrim01
estat hettest

reg polint_mean `controls' integr_econ integr_social integr_cult ident_net ident_mean discrim01
estat hettest
estat vif

*Mean polint plus media index and discrimination
svy: reg polint_mean `controls' integr_econ integr_social integr_cult ident_net ident_mean discrim01 mediaindex

*Net polint plus media index and discrimination
svy: reg polint_net `controls' integr_econ integr_social integr_cult ident_net ident_mean discrim01 mediaindex

*Mean polint plus media index and discrimination index
svy: reg polint_mean `controls' integr_econ integr_social integr_cult ident_net ident_mean self_discrim_idx mediaindex

*Net polint plus media index and discrimination index
svy: reg polint_net `controls' integr_econ integr_social integr_cult ident_net ident_mean self_discrim_idx mediaindex

*Preparation of two-dimensional coefficient plot
// The plot is generated using ggplot in R
// See Folder "2dimcoeffplot_theor" for replication file of Figure 2 (Panel A)
// See Folder "2dimcoeffplot_control" for replication file of Figure 2 (Panel B)

svy: reg polint_mean `controls' integr_econ integr_social integr_cult ident_net ident_mean discrim01, level(90)

gen coeff_mean =.
replace coeff_mean = e(b)[1,1] in 1
replace coeff_mean = e(b)[1,2] in 2
replace coeff_mean = e(b)[1,3] in 3
replace coeff_mean = e(b)[1,4] in 4
replace coeff_mean = e(b)[1,5] in 5
replace coeff_mean = e(b)[1,6] in 6
replace coeff_mean = e(b)[1,7] in 7
replace coeff_mean = e(b)[1,8] in 8
replace coeff_mean = e(b)[1,9] in 9
replace coeff_mean = e(b)[1,10] in 10
replace coeff_mean = e(b)[1,11] in 11
replace coeff_mean = e(b)[1,12] in 12
replace coeff_mean = e(b)[1,13] in 13
replace coeff_mean = e(b)[1,14] in 14
replace coeff_mean = e(b)[1,15] in 15

mat low_meanmat = r(table)
gen low_mean =.
replace low_mean = low_meanmat[5,1] in 1
replace low_mean = low_meanmat[5,2] in 2
replace low_mean = low_meanmat[5,3] in 3
replace low_mean = low_meanmat[5,4] in 4
replace low_mean = low_meanmat[5,5] in 5
replace low_mean = low_meanmat[5,6] in 6
replace low_mean = low_meanmat[5,7] in 7
replace low_mean = low_meanmat[5,8] in 8
replace low_mean = low_meanmat[5,9] in 9
replace low_mean = low_meanmat[5,10] in 10
replace low_mean = low_meanmat[5,11] in 11
replace low_mean = low_meanmat[5,12] in 12
replace low_mean = low_meanmat[5,13] in 13
replace low_mean = low_meanmat[5,14] in 14
replace low_mean = low_meanmat[5,15] in 15

mat up_meanmat = r(table)
gen up_mean =.
replace up_mean = up_meanmat[6,1] in 1
replace up_mean = up_meanmat[6,2] in 2
replace up_mean = up_meanmat[6,3] in 3
replace up_mean = up_meanmat[6,4] in 4
replace up_mean = up_meanmat[6,5] in 5
replace up_mean = up_meanmat[6,6] in 6
replace up_mean = up_meanmat[6,7] in 7
replace up_mean = up_meanmat[6,8] in 8
replace up_mean = up_meanmat[6,9] in 9
replace up_mean = up_meanmat[6,10] in 10
replace up_mean = up_meanmat[6,11] in 11
replace up_mean = up_meanmat[6,12] in 12
replace up_mean = up_meanmat[6,13] in 13
replace up_mean = up_meanmat[6,14] in 14
replace up_mean = up_meanmat[6,15] in 15

svy: reg polint_net `controls' integr_econ integr_social integr_cult ident_net ident_mean discrim01, level(90)

gen coeff_net =.
replace coeff_net = e(b)[1,1] in 1
replace coeff_net = e(b)[1,2] in 2
replace coeff_net = e(b)[1,3] in 3
replace coeff_net = e(b)[1,4] in 4
replace coeff_net = e(b)[1,5] in 5
replace coeff_net = e(b)[1,6] in 6
replace coeff_net = e(b)[1,7] in 7
replace coeff_net = e(b)[1,8] in 8
replace coeff_net = e(b)[1,9] in 9
replace coeff_net = e(b)[1,10] in 10
replace coeff_net = e(b)[1,11] in 11
replace coeff_net = e(b)[1,12] in 12
replace coeff_net = e(b)[1,13] in 13
replace coeff_net = e(b)[1,14] in 14
replace coeff_net = e(b)[1,15] in 15

mat low_netmat = r(table)
gen low_net =.
replace low_net = low_netmat[5,1] in 1
replace low_net = low_netmat[5,2] in 2
replace low_net = low_netmat[5,3] in 3
replace low_net = low_netmat[5,4] in 4
replace low_net = low_netmat[5,5] in 5
replace low_net = low_netmat[5,6] in 6
replace low_net = low_netmat[5,7] in 7
replace low_net = low_netmat[5,8] in 8
replace low_net = low_netmat[5,9] in 9
replace low_net = low_netmat[5,10] in 10
replace low_net = low_netmat[5,11] in 11
replace low_net = low_netmat[5,12] in 12
replace low_net = low_netmat[5,13] in 13
replace low_net = low_netmat[5,14] in 14
replace low_net = low_netmat[5,15] in 15

mat up_netmat = r(table)
gen up_net =.
replace up_net = up_netmat[6,1] in 1
replace up_net = up_netmat[6,2] in 2
replace up_net = up_netmat[6,3] in 3
replace up_net = up_netmat[6,4] in 4
replace up_net = up_netmat[6,5] in 5
replace up_net = up_netmat[6,6] in 6
replace up_net = up_netmat[6,7] in 7
replace up_net = up_netmat[6,8] in 8
replace up_net = up_netmat[6,9] in 9
replace up_net = up_netmat[6,10] in 10
replace up_net = up_netmat[6,11] in 11
replace up_net = up_netmat[6,12] in 12
replace up_net = up_netmat[6,13] in 13
replace up_net = up_netmat[6,14] in 14
replace up_net = up_netmat[6,15] in 15

*Export matrix for two-dimensional coefficient plot
keep coeff_mean low_mean up_mean coeff_net low_net up_net
drop if coeff_mean ==.
export excel using "2dim_coeffplot", replace